package com.bwie.system.service;

import com.bwie.common.domain.Stu;
import com.bwie.system.mapper.StuMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StuServiceImpl implements StuService {

    @Autowired
    StuMapper stuMapper;
    @Override
    public PageInfo<Stu> stulist(Stu stu) {
        PageHelper.startPage(stu.getPageNum(),stu.getPageSize());
      List<Stu> stus= stuMapper.stulist(stu);
        PageInfo<Stu> stuPageInfo = new PageInfo<>(stus);
        return stuPageInfo;
    }

    @Override
    public int upd(Stu stu) {
        return 0;
    }

    @Override
    public int add(Stu stu) {
        return stuMapper.add(stu);
    }
}
